<?php
declare(strict_types=1);
/**
 * MineAdmin is committed to providing solutions for quickly building web applications
 * Please view the LICENSE file that was distributed with this source code,
 * For the full copyright and license information.
 * Thank you very much for using MineAdmin.
 *
 * @Author X.Mo<root@imoi.cn>
 * @Link   https://gitee.com/xmo/MineAdmin
 */
namespace Plugin\File\Http\Request\Admin;

use Hyperf\Validation\Request\FormRequest;

/**
 * 预警录像回放验证数据类
 */
class RdFilePlaybackVideoRequest extends FormRequest
{
    /**
     * 场景配置
     */
    protected array $scenes = [
        'index' => [
            'file_url',
            'yj_data_id',
            'created_at',
            'updated_at',
        ],
        'create' => [
            'file_url',
            'yj_data_id',
        ],
        'update' => [
            'file_url',
            'yj_data_id',
        ]
    ];

    public function authorize(): bool
    {
        return true;
    }


    /**
     * 新增数据验证规则
     * return array
     */
    public function rules(): array
    {
        return [
            'id' => 'integer|min:1',
            'ids' => 'array|min:1',
            'ids.*' => 'integer|min:1',

            'file_url' => 'nullable|string|max:255',
            'yj_data_id' => 'nullable|string|max:128',
        ];
    }


    /**
     * 字段映射名称
     * return array
     */
    public function attributes(): array
    {
        return [
            'id' => '主键',

        ];
    }

public function messages(): array
{
    return [
            'id.required' => '必填',

    ];
}
}